package cn.retail.product.handler.controller;

import cn.ybb.product.model.PrePayReq;
import cn.ybb.product.model.PrePayRes;
import cn.ybb.product.service.PreparePayService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author duanweidong
 * @date 2024/4/23 16:09
 */

@RestController
@RequestMapping("/pay")
public class PreparePayController {

    @DubboReference(version= "1.0.0")
    private PreparePayService preparePayService;

    @PostMapping("/prepare")
    public PrePayRes pay(@RequestBody PrePayReq prePayReq) {
        return this.preparePayService.preparePay(prePayReq);
    }
}
